<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <f:view contentType="text/html" >
        <h:head>
            <f:facet name="first">
                <meta http-equiv="X-UA-Compatible" content="EmulateIE8" />
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <title>BdDint - PMES</title>
            </f:facet>
            
            <link type="text/css" rel="stylesheet" href="#{request.contextPath}/css/default.css" />
            <link type="text/css" rel="stylesheet" href="#{request.contextPath}/css/syntaxhighlighter/syntaxhighlighter.css" />

            <style type="text/css">
                .ui-layout-north {
                    z-index:20 !important;
                    overflow:visible !important;
                }

                .ui-layout-north .ui-layout-unit-content {
                    overflow:visible !important;
                }
                
                .ui-stack {
                	/*right: 280px;*/
                	bottom: 50px;
                }
            </style>
        </h:head>


        <h:body style="font-size: 12px;  background-color:#333;" >
	        <p:growl id="growl" showDetail="true" sticky="false" life="3000"/>
<!-- 			<p:ajax event="unload" listener="#{loginBean.logout}" /> -->		       
        
        	<p:dialog id="janelaLogin" header="Login" widgetVar="dlg_login" draggable="true" resizable="false" closable="false" visible="#{(!loginBean.loggedIn)}" modal="true" width="400" hideEffect="explode" style="text-align:justify;">
	        	<h:form>
	                <center>
	                	<h:outputText value="Atenção!" style="font-weight: bold; color: #ff0000; font-size: 14px;"/>
                	</center>
	                <br/>
	                <h:outputText value="Você é responsável por manter o sigilo das fotos e dos dados consultados, devendo utilizá-los exclusivamente para o serviço, sendo vedada a divulgação dos mesmos. Todo o conteúdo acessado é considerado CONFIDENCIAL, devendo respeitar as regras de acesso a conhecimento classificado constantes no Decreto Federal 4.553 de 27 de dezembro de 2002." />
					<br />
					<br />
					<h:panelGrid columns="2">
						<p:outputLabel for="it_login" value="RG.:"/>
						<p:inputText id="it_login" required="true" value="#{loginBean.username}" />
						<p:outputLabel for="it_senha" value="Senha.: "/>
						<p:password id="it_senha" required="true" value="#{loginBean.password}" />
						
						<p:commandButton id="loginButton" value="Entrar" update=":growl :corpo" actionListener="#{loginBean.login}" oncomplete="handleLoginRequest(xhr, status, args) " ajax="false"/>
					
						<script type="text/javascript">
							function handleLoginRequest(xhr, status, args) {
								if(args.validationFailed || !args.loggedIn) {
									jQuery('#janelaLogin').effect("shake", { times:3 }, 100);
								} else {
									dlg_login.hide();
									//jQuery('#janelaLogin').fadeOut();
								}
							}
						</script>
					</h:panelGrid>
				</h:form>
	        </p:dialog>
	        
	        <!-- principal.xhtml -->
	        <p:panel id="corpo" > <!-- todo o conteudo do site deve ficar dentro desta tag, para que ao ser enviado o login possa rerenderizar ecibindo ou ocultando seu conteúdo-->
	        	
	        	<p:idleMonitor widgetVar="comfirmacao" timeout="1800000"  onidle="idleDialog.show()" rendered="#{(loginBean.loggedIn)}">
					<p:dialog header="AVISO" severity="alert" widgetVar="idleDialog" visible="false" closable="false" modal="true">					
						<h:outputText value="Sua sessão foi encerrada por falta de atividade!" />
					</p:dialog>
					<p:ajax event="active" listener="#{loginBean.logout}" update=":corpo :janelaLogin :growl" oncomplete="idleDialog.hide()" />						
				</p:idleMonitor>
			
<!-- 				<p:idleMonitor widgetVar="automatica" timeout="15000" update=":growl" >	 -->
<!-- 				    <p:ajax event="idle" listener="#{idleMonitorBean.idleListener}" update=":growl" />  -->
<!-- 				    <p:ajax event="active" listener="#{idleMonitorBean.activeListener}" update=":growl" oncomplete="idleDialog.hide()" /> -->
<!-- 				</p:idleMonitor>   -->		                 
        	
	    		<p:layout id="layout" fullPage="true" resizeTitle="false" rendered="#{(loginBean.loggedIn)}">
	
	                <p:layoutUnit id="top" position="north" size="90">
	                	<h:panelGrid columns="2" cellspacing="0" cellpadding="0" style="background-image: url(./images/texture_fundo_topo1.png); min-width: 100%; min-heigth: 83px; max-heigth: 83px;">
 		                	<p:graphicImage value="/images/titulo.png" alt="SIPOM"/>
 		                	<p:spacer width="1" height="83"></p:spacer>
<!--  		                	<p:graphicImage value="/images/distintivo2.png" alt="DINT" style="height:83px; float:right;"/> -->
	                																			

						</h:panelGrid>
	                </p:layoutUnit>
	
	                <p:layoutUnit id="bottom" position="south" size="30" >
	                	<center>	               
		                	<h:panelGrid columns="3" cellspacing="0" cellpadding="0">
			                    <h:outputText value="#{loginBean.username}"/>						                                        
			                    <p:spacer width="100" height="1" />
			                    <h:outputText value="#{dateSisBean.data}" />
							</h:panelGrid>
						</center>
	                </p:layoutUnit>
	
	                <p:layoutUnit id="left" position="west" size="300" resizable="true"  minSize="200" >
	                
	                    <p:accordionPanel>
	                        <p:tab title="Menu 1">
	                            <br />
	                            <p:calendar mode="inline" navigator="none" locale="pt"/>
	                            <br />
	                        </p:tab>
	
	                        <p:tab title="Menu 2">
	                        	
	                        </p:tab>
	
	                        <p:tab title="Menu 3">
	                            <h:outputText value="Menu 3 Content" />
	                        </p:tab>
	                    </p:accordionPanel>
	                    
	                </p:layoutUnit>
	
	                <p:layoutUnit id="center" position="center" >						
						<h:form>			
							<p:dashboard id="board" model="#{dashboardBean.model}" style="margin:10px; text-align:center;" >        
						        <p:panel id="bddint" style="margin:10px; width:100px;">
						        	<h:outputLink value="./BdDint.xhtml" target="blank">
						            	<p:graphicImage value="/images/sipom.png" style=" width:55px;" title="BdDint" />
						            	<h:outputText value="BdDint"  />
						            </h:outputLink>
						        </p:panel>
						
						        <p:panel id="psesp" style="margin:10px; width:100px;">
						        	<h:outputLink value="http://dint.es.gov.br" target="blank">
							            <p:graphicImage value="/images/portal_sesp.png"  style=" width:55px;" title="Portal Sesp" />
							            <h:outputText value="Portal Sesp" />
						            </h:outputLink>
						        </p:panel>
						
						        <p:panel id="infoseg" style="margin:10px; width:100px;">
						            <h:outputLink value="https://www2.infoseg.gov.br/infoseg/do/TecladoVirtualAction" target="blank">
							            <p:graphicImage value="/images/infoseg.png"  style=" width:55px;" title="Infoseg" />
							            <h:outputText value="Infoseg"  />
						            </h:outputLink>
						        </p:panel>
						
						        <p:panel id="detran" style="margin:10px; width:100px;">
						            <h:outputLink value="https://www2.infoseg.gov.br/infoseg/do/TecladoVirtualAction" target="blank">
							            <p:graphicImage value="/images/detran.png"  style=" width:55px;" title="Detran" />
							            <h:outputText value="Detran"  />
						            </h:outputLink>
						        </p:panel>
						
						        <p:panel id="ecops" style="margin:10px; width:100px;">
						            <h:outputLink value="http://spsa0001.sesp.es.gov.br:7779/forms90/f90servlet?config=ecops" target="blank">
							            <p:graphicImage value="/images/ecops.png"  style=" width:55px;" title="e-Cops" /><br/>
							            <h:outputText value="e-Cops"  />
						            </h:outputLink>
						        </p:panel>
						        
						        <p:panel id="pm" style="margin:10px; width:100px;">
						            <h:outputLink value="http://www.pm.es.gov.br/" target="blank">
							            <p:graphicImage value="/images/pm.png"  style=" width:55px;" title="Polícia Militar" /><br/>
							            <h:outputText value="PMES"  />
						            </h:outputLink>
						        </p:panel>
						        
						        <p:panel id="webmail" style="margin:10px; width:100px;">
						            <h:outputLink value="http://webmail.pm.es.gov.br/Login.aspx?ReturnUrl=%2fdefault.aspx" target="blank">
							            <p:graphicImage value="/images/mail.png"  style=" width:55px;" title="WebMail" /><br/>
							            <h:outputText value="WebMail"  />
						            </h:outputLink>
						        </p:panel>
						        
						    </p:dashboard>							    
					    </h:form>
						
						<h:form>
						    <p:stack icon="/images/stack/stack.png" >
								<p:menuitem value="eCops" icon="/images/stack/ecops.png" url="http://spsa0001.sesp.es.gov.br:7779/forms90/f90servlet?config=ecops" target="blank" title="e-Cops"/>
								<p:menuitem value="Detran" icon="/images/stack/detran.png" url="#" target="_blank" title="Detran"/>
								<p:menuitem value="Infoseg" icon="/images/stack/infoseg.png" url="https://www2.infoseg.gov.br/infoseg/do/TecladoVirtualAction" target="blank" title="Infoseg"/>
								<p:menuitem value="Sesp" icon="/images/stack/portal_sesp.png" url="#" target="_blank" title="Portal Sesp"/>
								<p:menuitem value="BdDint" icon="/images/stack/sipom.png" url="http://dint.es.gov.br" target="blank" title="BdDint"/>
							</p:stack>
						</h:form>
	                
	                </p:layoutUnit>
	
	            </p:layout> 
            </p:panel>
            <!-- fim - principal.xhtml -->
        </h:body>

    </f:view>
</html>

